package thread;

import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class ScheduleThreadPoolExecutorDemo {
    public static void main(String[] args) {
        ScheduledThreadPoolExecutor scheduleThreadPoolExecutor = new ScheduledThreadPoolExecutor(1);
        scheduleThreadPoolExecutor.scheduleAtFixedRate(()->{
            System.out.println("定时线程池测试");
        },2,2, TimeUnit.SECONDS);
    }
}
